<template>
<div class="Choose1div1">
    <C1Right/>
    <C1Left/>
    <C1Down/>
    <C1FoodCart/>

</div>
</template>

<script>
import C1Left from './C1Left.vue'
import C1Right from './C1Right.vue'
import C1Down from './C1Down.vue'
import C1FoodCart from './C1FoodCart.vue'
export default {
    name:'Choose1',
    components:{C1Left,C1Right,C1Down,C1FoodCart},
    data(){
        return{
            scroll:0,
            CartShowValue:0,
            }
    },
    methods:{
        handleScroll(){
            this.scroll=document.documentElement.scrollTop || document.body.scrollTop
            this.$bus.$emit('scroll',this.scroll)
        },
    },
    mounted(){
        document.documentElement.scrollTop=0
        document.body.scrollTop=0
        window.addEventListener("scroll", this.handleScroll);
        this.$bus.$on('LefttoDad',(value)=>{
            document.documentElement.scrollTop=value
            document.body.scrollTop=value
            console.log(value,'%%');
        })
    },
    beforeDestroy(){
        this.$bus.$off('LefttoDad')
    }
}
</script>

<style scoped>
.Choose1div1{
    height: 800px;
}
</style>